
var myEcharts2;
$(function(){
	myEcharts2 = echarts.init(document.getElementById('myEcharts2'));
})
function setEcharts2(value,sum){
	var nanValue = parseInt(value/sum*100);
	var option = {
	    title: [{
	        text: '男性',
	        left: '50%',
	        top: '75%',
	        textAlign: 'center',
	        textStyle: {
	            fontWeight: 'bold',
	            fontSize: '16',
	            color: '#0fb5da',
	            textAlign: 'center',
	        },
	    }],
	    tooltip: {
	        trigger: 'item',
	        formatter: value+' 人'
	    },
	    //第一个图表
	    series: [{
	            type: 'pie',
	            radius: ['65%', '80%'],
	            center: ['50%', '55%'],
	            startAngle: 225,
	            labelLine: {
	                normal: {
	                    show: false
	                }
	            },
	            label: {
	                normal: {
	                    position: 'center'
	                }
	            },
	            data: [{
	                    value: 100,
	                    itemStyle: {
	                        normal: {
	                            color: '#345979a6'
	                        }
	                    },
	                }, {
	                    value: 35,
	                    itemStyle: {
	                           normal: {
	                            label: {
	                                show: false
	                            },
	                            labelLine: {
	                                show: false
	                            },
	                            color: "rgba(0,0,0,0)",
	                            borderWidth: 0
	                        },
	                        emphasis: {
	                            color: "rgba(0,0,0,0)",
	                            borderWidth: 0
	                        }
	                    },
	                },

	            ]
	        },
	        //上层环形配置
	        {
	            type: 'pie',
	            hoverAnimation: false, //鼠标经过的特效
	            radius: ['65%', '80%'],
	            center: ['50%', '55%'],
	            startAngle: 225,
	            labelLine: {
	                normal: {
	                    show: false
	                }
	            },
	            label: {
	                normal: {
	                    position: 'center'
	                }
	            },
	            data: [{
	                    value: nanValue,
	                    itemStyle: {
	                        normal: {
	                            color: '#0fb5da'
	                        }
	                    },
	                    label: {
	                        normal: {
	                            formatter: '{c}%',
	                            position: 'center',
	                            show: true,
	                            textStyle: {
	                                fontSize: '18',
	                                fontWeight: 'normal',
	                                color: '#b4d8e0'
	                            }
	                        }
	                    },
	                }, {
	                    value: 35,
	                    itemStyle: {
	                        normal: {
	                            label: {
	                                show: false
	                            },
	                            labelLine: {
	                                show: false
	                            },
	                            color: "rgba(0,0,0,0)",
	                            borderWidth: 0
	                        },
	                        emphasis: {
	                            color: "rgba(0,0,0,0)",
	                            borderWidth: 0
	                        }
	                    },
	                },

	            ]
	        },


	    ]
	};
	myEcharts2.setOption(option);
}




